﻿using System;

namespace Drill.LocatorPattern
{
	/// <summary>
	/// Implemented by class that are used to locate an instance of a type.
	/// </summary>
	/// <typeparam name="T">The type to be located.</typeparam>
	public interface ILocator<out T> : IDisposable
		where T : class
	{
		/// <summary>
		/// Locates an instance of the type.
		/// </summary>
		/// <returns>
		/// An instance of the type or null if the instance could not be located.
		/// </returns>
		T Locate();
	}
}